Skip to content

Add rule for recent Crate compromises; run fmt to pick up new yara-x newline formatting#1140

Merged
egibs merged 3 commits into
chainguard-dev:mainfrom
egibs:rust-stealer
Sep 26, 2025
Merged

Add rule for recent Crate compromises; run fmt to pick up new yara-x newline formatting#1140
egibs merged 3 commits into
chainguard-dev:mainfrom
egibs:rust-stealer

Conversation

@egibs

@egibs egibs commented Sep 26, 2025

Copy link
Copy Markdown
Member

This PR adds a rule for the recent Crates.io compromises. It's a bit contrived for the specific sample (i.e., it likely won't apply in a generic sense).

Also, yara-x now formats rules in a slightly different way so I handled that as part of compiling and formatting the new rule.

…newline formatting

Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
@egibs egibs requested a review from eslerm September 26, 2025 18:29
Comment thread rules/exfil/stealer/creds.yara Outdated
Comment on lines +111 to +113
$regex1 = "Regex::new(r#\"\\[(?:\\s*0x[0-9a-fA-F]{1,2}\\s*,?\\s*)+\\]|\\[(?:\\s*\\d{1,3}\\s*,?\\s*)+\\]\"#)?"
$regex2 = "Regex::new(r#\"\"[1-9A-HJ-NP-Za-km-z]{32,44}\"\"#)?"
$regex3 = "Regex::new(r#\"\"0x[0-9a-fA-F]{64}\"\"#)?"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be given different variable names besides "regex" to indicate the types of patterns they're trying to match? I'm guessing they are wallet addresses for various coin types... but that's a guess.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in bf75db1 (#1140)

Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
@egibs egibs requested a review from stevebeattie September 26, 2025 19:01
@egibs egibs merged commit f3941a7 into chainguard-dev:main Sep 26, 2025
12 checks passed
@egibs egibs deleted the rust-stealer branch October 31, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants